package com.atguigu.krp.controller;

import com.atguigu.krp.handler.ServerRun;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.annotation.PostConstruct;

/**
 * @author KEIO  on 2022/1/14.
 * @version 1.0
 */
@Slf4j
@Controller
public class ServerController {

    @Autowired
    ServerRun serverRun;

    //避免自动注入失败   空指针
    //private static ServerController serverController;

    @PostConstruct
    public void init() {

        try {
            log.info("krp执行启动逻辑");
            serverRun.start();
        } catch (Exception e) {
            e.printStackTrace();
        }


    }




}
